/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package personal.utility;

import java.util.List;
import personal.jaxb.Books;
import personal.obj.Book;

/**
 *
 * @author PHATNBSE61057
 */
public class Utility {

    public Utility() {
    }

    public personal.obj.Book transferBookType(personal.validation.Book vBook) {
        personal.obj.Book book = new Book();
        book.setBookAuthor(vBook.getBookAuthor());
        book.setBookDescription(vBook.getBookDescription());
        book.setBookDetailedEdition(vBook.getBookDetailedEdition());
        book.setBookFormat(vBook.getBookFormat());
        book.setBookID(vBook.getBookID());
        book.setBookISBN(vBook.getBookISBN());
        book.setBookImg(vBook.getBookImg());
        book.setBookLink(vBook.getBookLink());
        book.setBookName(vBook.getBookName());
        if (vBook.getBookPages() != null) {
            book.setBookPages(vBook.getBookPages().toString());
        }
        String price = "£" + String.valueOf(vBook.getBookPrice());
        book.setBookPrice(price);
        book.setBookPublishedDate(vBook.getBookPublishedDate());
        book.setBookThumb(vBook.getBookThumb());
        book.setCategoryID(vBook.getCategoryID());
        return book;
    }
}
